package com.hec.yygh.hosp.controller;

import com.hec.yygh.common.result.R;
import com.hec.yygh.hosp.service.ScheduleService;
import com.hec.yygh.model.hosp.Schedule;
import com.hec.yygh.vo.hosp.ScheduleOrderVo;
import com.sun.org.apache.regexp.internal.RE;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Map;

@RestController
@RequestMapping("/admin/hosp/schedule")
public class ScheduleController {

    @Autowired
    private ScheduleService scheduleService;

    @GetMapping("/getScheduleRule/{page}/{limit}/{hoscode}/{depcode}")
    public R getScheduleRule(@PathVariable("page")Long page,
                             @PathVariable("limit")Long limit,
                             @PathVariable("hoscode")String hoscode,
                             @PathVariable("depcode")String depcode){
        Map<String,Object> map = scheduleService.getScheduleRule(page,limit,hoscode,depcode);
        return R.ok().data(map);
    }

    @GetMapping("/getScheduleDetail/{hoscode}/{depcode}/{workDate}")
    public R getDetailSchedule(@PathVariable("hoscode")String hoscode,
                               @PathVariable("depcode")String depcode,
                               @PathVariable("workDate")String workDate) {
        List<Schedule> list = scheduleService.getDetailSchedule(hoscode,depcode,workDate);
        return R.ok().data("list",list);
    }



}
